package com.kl.feign.fallback;


import com.kl.domain.*;
import com.kl.em.ConstantEnum;
import com.kl.em.Result;
import com.kl.feign.UserServiceFeign;
import org.springframework.stereotype.Component;

import java.util.List;

//实现类,放容器,重写方法
//降级
@Component
public class UserServiceFeignFallback implements UserServiceFeign {
    @Override
    public Result<UserDTO> selectById(Long userId) {
        //书写降级逻辑,大多数打印日志
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result updateInfo(UserDTO userDTO) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result<List<TbContactsDTO>> selectById(String userName) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result inserInto(TbContactsDTO tbContactsDTO) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result updateInfo(TbContactsDTO tbContactsDTO) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result deleteById(Long tbId) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result<UserScoreDTO> selectByScoreId(Long userId) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result inserInto(Long userId, Integer score) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result updateInfo(Long userId, Integer score) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result deleteByScoreId(Long userId) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result<List<CouponDTO>> selectByCouponId(String userId) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result insertById(Long userId, Long cid) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result deleteByCouponId(Long cid) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result<List<TbTaxpayerDTO>> selectByTaxpayerId(String userName) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result inserInto(TbTaxpayerDTO tbTaxpayerDTO) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result updateInfo(TbTaxpayerDTO tbTaxpayerDTO) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result deleteByTaxpayerId(Long tbId) {
        return Result.build(ConstantEnum.FaillBack);
    }

    @Override
    public Result<CouponDTO> selectId(String id) {
        return Result.build(ConstantEnum.FaillBack);
    }
}
